# 4.10 切片
travels = ['nanjing', 'beijing', 'qingdao', 'chengdu', 'xiamen']
print('The first three items are:')
for travel in travels[:3]:
    print(travel)
print('Three items from the middle of the list are:')
for travel in travels[1:4]:
    print(travel)
print('The last three items are:')
for travel in travels[-3:]:
    print(travel)

# 4.11
My_pizzas = ['olives', 'anchovies', 'mushrooms']
friend_pizzas = My_pizzas[:]
print(My_pizzas)
print(friend_pizzas)
My_pizzas.append('china')
friend_pizzas.append('english')
print(f"My favorite pizzas are: ")
for pizza in My_pizzas:
    print(pizza)
print(f"My firend's favorite pizzas are: {friend_pizzas}")
for pizza in friend_pizzas:
    print(pizza)